

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>修改用户信息</title>
  {include file="include/top"}
</head>
<body>

  <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">
    <div class="layui-form-item">
      <label class="layui-form-label">用户名</label>
      <div class="layui-input-inline">
        <input type="text" name="username" value="{$user.username}" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">密码</label>
      <div class="layui-input-inline">
        <input type="text" name="password" placeholder="请输入密码,不修改请留空" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">个人密码</label>
      <div class="layui-input-inline">
        <input type="text" name="password2" placeholder="用于登录会员后台管理" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">手机号码</label>
      <div class="layui-input-inline">
        <input type="text" name="phone" value="{$user.phone}" lay-verify="phone" placeholder="请输入号码" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">昵称</label>
      <div class="layui-input-inline">
        <input type="text" name="fullname" value="{$user.fullname}" placeholder="请输入昵称" readonly autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label"></label>
      <div class="layui-input-inline">
      <button class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search">
        保存
      </button>
      </div>
    </div>
  </div>

  {include file="include/js"}
  <script>
    layui.config({
      base: '/layuiadmin/' //静态资源所在路径
    }).extend({
      index: 'lib/index' //主入口模块
    }).use(['index','form'],function () {
      var $=layui.$;
      var form=layui.form;
      form.on("submit(LAY-app-contlist-search)",function () {
        var password=$("input[name='password']").val();
        var password2=$("input[name='password2']").val();
        var phone=$("input[name='phone']").val();
        var fullname=$("input[name='fullname']").val();
        $.post("useredit",{password:password,password2:password2,phone:phone,fullname:fullname},function (re) {
          if(re.code==0){
            layer.msg("修改成功")
          }else{
            layer.msg(re.msg);
          }
        },"json")
        return false;
      })
    });
  </script>
</body>
</html>